package dyyx.util;

public class NetUtil {


	
	public static void main(String[] args) throws Exception {
		
		EchoClient client = new EchoClient("127.0.0.1",6789);
		int num = 10;
		for(int i=0;i<num;i++){
			String str = "hello"+i;
			str = client.doWriteLine(str);
			System.out.println(str);
		}
		client.close();
		
		try{
			client.doWriteLine("hello");
		}catch(Throwable e){
			// java.io.IOException: Stream closed
			System.out.println(e);
		}
		
	}
	

	
}
